<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>老猫系统</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/js/jquery.js"></script>
    <link href="/css/com.css" type="text/css" rel="stylesheet">
    <style>
        .godbody{position: relative; overflow: hidden; width: 100%;}
        .godbody .left{float: left; width: 30%; position: relative; overflow: hidden; background: #eee;}
        .godbody .left .im{display: block; width:100%; height: 40px; text-align: center; line-height: 40px; position: relative; overflow: hidden;}
        .godbody .left .im.o{color: #ff5500; background: #fff;}
        .godbody .left .im.a{color: #ff5500;background: #fff; font-weight: bold;}
        .godbody .right{float: left; width: 70%; position: relative; overflow: hidden;}

        #gods{position: relative; overflow: hidden;}
        #gods .itm{width: 100%;height: 100px; margin-left: 1%; margin-top: 10px;}
        #gods .itm .pic{width: 30%; height: 100px; float: left;}
        #gods .itm .pic img{width: 80px; height: 80px;}
        #gods .itm .ginfo{float: left; width: 50%;}
        #gods .itm .tit{color: #222;}
        #gods .itm .price{font-weight: bold; color: #ff5500;}
        #gods .itm .add{float: right;width: 20%; text-align: center; line-height: 100px;}
        #gods .itm .add img{width: 25px;}
    </style>
</head>
<body>
<div id="top">商品分类</div>
<div id="search">
    <div class="horn"><img src="/img/search.png"></div>
    <div class="notxt">
        <input type="text" name="search" placeholder="下单时间：9：30-10:30" autocomplete="off" class="layui-input">
    </div>
</div>

<div class="godbody">
    <div class="left">
        <a href="{:url('classify')}" class="im a">全部</a>
        {volist name='cate' id='c'}
        <a href="{:url('classify',['id'=>$c.id])}" class="im {if $id eq $c.id}o{/if}">{$c.name}</a>
        {/volist}
    </div>
    <div class="right" id="gods">
        {volist name='list' id='g'}
        <div class="itm">
            <div class="pic"><a href="{:url('goodsDetail',['id'=>$g.goods_id])}"><img src="<?php
             $pics=$g['pics'];
             $pic=explode(',',$pics);
             $f=true;
             for($i=0;$i<count($pic);$i++){
                if($pic[$i]!=''){
                    echo "/uploads/".$pic[$i];
                $f=false;
                break;
                }
                }
                if($f){
                echo "/img/default.png";
                }
                ?>"/></a></div>
            <div class="ginfo">
                <div class="tit">{$g.goods_title}</div>
                <div class="price">￥ {$g.goods_price}</div>
            </div>
            <div class="add"><img src="/img/add.png"></div>

        </div>
        {/volist}
    </div>
</div>

{include file="bottom"}
</body>
</html>